package com.ikdong.toodle.util;

import com.ikdong.toodle.R;
import com.ikdong.toodle.activity.BasicActivity;
import com.ikdong.toodle.widget.TaskTabAdapter;

public class TaskTabAdapterFactory {
	public static TaskTabAdapter getTabAdapter(BasicActivity context,String view){
		TaskTabAdapter adapter = null;
		if(Constant.TASK_VIEW_TAB_MAIN.equalsIgnoreCase(view)){
			adapter = new TaskTabAdapter(context.getSupportFragmentManager(),context,context.getResources().getStringArray(R.array.task_views_main),view);
		}else if(Constant.TASK_VIEW_TAB_FOLDER.equalsIgnoreCase(view)){			
			adapter = new TaskTabAdapter(context.getSupportFragmentManager(),context,(new FolderManager(context)).getFolderNames(),view);
		}else if(Constant.TASK_VIEW_TAB_CONTEXT.equalsIgnoreCase(view)){
			adapter = new TaskTabAdapter(context.getSupportFragmentManager(),context,(new ContextManager(context)).getContextNames(),view);
		}else if(Constant.TASK_VIEW_TAB_GOAL.equalsIgnoreCase(view)){
			adapter = new TaskTabAdapter(context.getSupportFragmentManager(),context,(new GoalManager(context)).getGoalNames(),view);
		}else if(Constant.TASK_VIEW_TAB_DUEDATE.equalsIgnoreCase(view)){
			adapter = new TaskTabAdapter(context.getSupportFragmentManager(),context,context.getResources().getStringArray(R.array.task_views_duedate),view);
		}else if(Constant.TASK_VIEW_TAB_PRIORITY.equalsIgnoreCase(view)){
			adapter = new TaskTabAdapter(context.getSupportFragmentManager(),context,context.getResources().getStringArray(R.array.task_views_priority),view);
		}else if(Constant.TASK_VIEW_TAB_STATUS.equalsIgnoreCase(view)){
			adapter = new TaskTabAdapter(context.getSupportFragmentManager(),context,context.getResources().getStringArray(R.array.task_views_status),view);
		}else{
			adapter = new TaskTabAdapter(context.getSupportFragmentManager(),context,new String[]{},view);
		}
		
		return adapter;
	}
}
